package a.f.n;

import a.c.e;
import a.c.j;
import a.d.w;
import a.f.cd;
import a.f.o;

import java.awt.geom.Rectangle2D;
import java.awt.geom.Rectangle2D.Double;
import java.util.*;

public abstract class k
  implements bb
{
  protected double g = 20.0D;
  protected o h;
  protected final b_ i;
  protected a.c.k j;
  protected a.c.k k;
  protected List l;
  public static boolean m;
  public static boolean n;
  
  protected k(b_ paramb_)
  {
    this.i = paramb_;
  }
  
  public ib a(d paramd, o paramo, e parame)
  {
    return null;
  }
  
  protected w a(a.c.d paramd)
  {
    return a(this.i, this.h.r(paramd));
  }
  
  db.a_ a(a.c.d paramd, v paramv)
  {
    return new db.a_(this.i, this.h, paramd, paramv);
  }
  
  db.b_ a(e parame, v paramv)
  {
    return new db.b_(a(parame), paramv);
  }
  
  protected abstract v a(e parame, byte paramByte);
  
  protected v a(e parame)
  {
    return new v(this.i, (d.a_)this.k.get(parame));
  }
  
  protected v b(e parame)
  {
    v localv = new v(this.i, (d.a_)this.j.get(parame));
    this.l.add(localv);
    return localv;
  }
  
  public void a(e parame, j paramj)
  {
    boolean bool2 = n;
    boolean bool1 = m;
    this.h = ((o)parame.g());
    try
    {
      a.c.d locald = parame.h();
      do
      {
        if (locald == null) {
          break;
        }
        e locale = locald.f();
        byte b = d(locale);
        int i1 = a(b);
        paramj.a(locale, i1);
        locald = locald.i();
        if ((!bool2) && (bool1)) {
          return;
        }
      } while (!bool1);
      if (bool2) {}
    }
    finally
    {
      this.h = null;
    }
  }
  
  protected cd c(e parame)
  {
    boolean bool = n;
    a.c.d locald = parame.i();
    cd localcd;
    if (locald == null)
    {
      localcd = cd.a((byte)0);
      if (!bool) {
        if (!m) {
          break label53;
        }
      }
    }
    else
    {
      localcd = cd.e(this.h, locald);
    }
    if (!bool) {
      if (localcd == null) {
        localcd = cd.a((byte)0);
      }
    }
    label53:
    return a(localcd);
  }
  
  private cd a(cd paramcd)
  {
    boolean bool2 = n;
    boolean bool1 = m;
    a_ locala_1;
    if (!bool2) {
      if (paramcd.c())
      {
        locala_1 = a_.a;
        if ((!bool2) && (!bool1)) {
          break label111;
        }
      }
    }
    if (!bool2) {
      if (paramcd.e())
      {
        locala_1 = a_.b;
        if ((!bool2) && (!bool1)) {
          break label111;
        }
      }
    }
    if (!bool2) {
      if (paramcd.d())
      {
        locala_1 = a_.c;
        if (!bool2) {
          if (!bool1) {
            break label111;
          }
        }
      }
      else
      {
        if (bool2) {
          break label110;
        }
      }
    }
    if (paramcd.f())
    {
      locala_1 = a_.d;
      if (!bool1) {}
    }
    else
    {
      label110:
      return paramcd;
    }
    label111:
    a_ locala_2 = locala_1.a(this.i.a());
    if (!bool2) {
      if (locala_2.equals(a_.a)) {
        return cd.a((byte)1);
      }
    }
    if (!bool2) {
      if (locala_2.equals(a_.b)) {
        return cd.a((byte)4);
      }
    }
    if (!bool2) {
      if (locala_2.equals(a_.c)) {
        return cd.a((byte)2);
      }
    }
    if ((bool2) || (locala_2.equals(a_.d))) {
      return cd.a((byte)8);
    }
    throw new RuntimeException("Should not reach... " + paramcd);
  }
  
  protected byte a(byte paramByte)
  {
    boolean bool2 = n;
    boolean bool1 = m;
    a_ locala_1;
    switch (paramByte)
    {
    case 0: 
      locala_1 = a_.a;
      if (!bool2) {
        if (!bool1) {
          break label136;
        }
      }
    case 1: 
      locala_1 = a_.b;
      if (!bool2) {
        if (!bool1) {
          break label136;
        }
      }
    case 2: 
      locala_1 = a_.c;
      if (!bool2) {
        if (!bool1) {
          break label136;
        }
      }
    case 3: 
      locala_1 = a_.d;
      if ((!bool2) && (!bool1)) {
        break label136;
      }
    case -1: 
      return -1;
    case -2: 
      return -2;
    }
    throw new IllegalArgumentException("Not implemented for " + paramByte);
    label136:
    a_ locala_2 = locala_1.a(this.i);
    if (!bool2) {
      if (locala_2.equals(a_.a)) {
        return 0;
      }
    }
    if (!bool2) {
      if (locala_2.equals(a_.b)) {
        return 1;
      }
    }
    if (!bool2) {
      if (locala_2.equals(a_.c)) {
        return 2;
      }
    }
    if ((bool2) || (locala_2.equals(a_.d))) {
      return 3;
    }
    throw new RuntimeException("Should not reach... " + paramByte);
  }
  
  protected byte b(byte paramByte)
  {
    boolean bool2 = n;
    boolean bool1 = m;
    a_ locala_1;
    switch (paramByte)
    {
    case 0: 
      locala_1 = a_.a;
      if (!bool2) {
        if (!bool1) {
          break label136;
        }
      }
    case 1: 
      locala_1 = a_.b;
      if (!bool2) {
        if (!bool1) {
          break label136;
        }
      }
    case 2: 
      locala_1 = a_.c;
      if (!bool2) {
        if (!bool1) {
          break label136;
        }
      }
    case 3: 
      locala_1 = a_.d;
      if ((!bool2) && (!bool1)) {
        break label136;
      }
    case -1: 
      return -1;
    case -2: 
      return -2;
    }
    throw new IllegalArgumentException("Not implemented for " + paramByte);
    label136:
    a_ locala_2 = locala_1.a(this.i.a());
    if (!bool2) {
      if (locala_2.equals(a_.a)) {
        return 0;
      }
    }
    if (!bool2) {
      if (locala_2.equals(a_.b)) {
        return 1;
      }
    }
    if (!bool2) {
      if (locala_2.equals(a_.c)) {
        return 2;
      }
    }
    if ((bool2) || (locala_2.equals(a_.d))) {
      return 3;
    }
    throw new RuntimeException("Should not reach... " + paramByte);
  }
  
  protected abstract byte d(e parame);
  
  public d.a_ a(a.c.k paramk1, a.c.k paramk2, o paramo, e parame, byte paramByte)
  {
    this.j = paramk2;
    this.k = paramk1;
    this.h = paramo;
    try
    {
      this.l = new ArrayList();
      v localv = a(parame, b(paramByte));
      localv.n();
      d.a_ locala_ = localv.m();
      return locala_;
    }
    finally
    {
      paramk2 = null;
      paramk1 = null;
      paramo = null;
    }
  }
  
  public b_ b()
  {
    return this.i;
  }
  
  public Comparator c()
  {
    boolean bool = n;
    j.a_ locala_;
    if (this.i.a(0, 0) == 0.0D)
    {
      locala_ = new j.a_(true);
      if (!bool)
      {
        if (this.i.c(1).a() < 0.0D)
        {
          if (bool) {
            break label93;
          }
          locala_.a(-1);
        }
      }
      else if (!m) {}
    }
    else
    {
      locala_ = new j.a_(false);
      if (this.i.c(0).a() < 0.0D) {
        locala_.a(-1);
      }
    }
    label93:
    return locala_;
  }
  
  public static w a(b_ paramb_, w paramw)
  {
    if (!n) {
      if (paramw == null) {
        return null;
      }
    }
    a_ locala_1 = a_.a(paramw.a(), paramw.b());
    a_ locala_2 = locala_1.a(paramb_.a());
    return new w(locala_2.a(0), locala_2.a(1));
  }
  
  public double d()
  {
    return this.g;
  }
  
  public void a(double paramDouble)
  {
    this.g = paramDouble;
  }
  
  public Comparator a()
  {
    return c();
  }
  
  static class a_
  {
    static final a_ a = new a_(0.0D, -1.0D);
    static final a_ b = new a_(1.0D, 0.0D);
    static final a_ c = new a_(0.0D, 1.0D);
    static final a_ d = new a_(-1.0D, 0.0D);
    static final a_ e = new a_(0.0D, 0.0D);
    private final double[] g;
    private double h = (0.0D / 0.0D);
    
    private a_(double[] paramArrayOfDouble)
    {
      this.g = paramArrayOfDouble;
    }
    
    private a_(double paramDouble1, double paramDouble2)
    {
      this(new double[] { paramDouble1, paramDouble2 });
    }
    
    double a(a_ parama_)
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      double d1 = 0.0D;
      int i = 0;
      do
      {
        if (i >= this.g.length) {
          break;
        }
        double d2 = this.g[i];
        double d3 = parama_.a(i);
        if (!bool2)
        {
          if (bool1) {
            break label69;
          }
          d1 += d2 * d3;
          i++;
        }
      } while (!bool1);
      label69:
      return d1;
    }
    
    double a(int paramInt)
    {
      return this.g[paramInt];
    }
    
    a_ a(k.b_ paramb_)
    {
      double d1 = a(paramb_.c(0));
      double d2 = a(paramb_.c(1));
      return a(d1, d2);
    }
    
    public boolean a(Object paramObject)
    {
      boolean bool = k.n;
      if (!bool) {
        if (this == paramObject) {
          return true;
        }
      }
      if (paramObject != null)
      {
        if (bool) {
          break label37;
        }
        if (getClass() == paramObject.getClass()) {}
      }
      else
      {
        return false;
      }
      label37:
      a_ locala_ = (a_)paramObject;
      return Arrays.equals(this.g, locala_.g);
    }
    
    public String toString()
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      StringBuffer localStringBuffer = new StringBuffer("Vector:\n");
      int i = 0;
      do
      {
        if (i >= this.g.length) {
          break;
        }
        if (bool2) {
          break label92;
        }
        double d1 = this.g[i];
        localStringBuffer.append(d1).append(' ');
        i++;
        if (bool1) {
          break label91;
        }
      } while (!bool1);
      if ((!bool2) && (!bool2)) {
        if (this == a) {
          localStringBuffer.append("\n NORTH");
        }
      }
      label91:
      label92:
      if (!bool2) {
        if (this == b) {
          localStringBuffer.append("\n EAST");
        }
      }
      if (!bool2) {
        if (this == c) {
          localStringBuffer.append("\n SOUTH");
        }
      }
      if (this == d) {
        localStringBuffer.append("\n WEST");
      }
      return localStringBuffer.toString();
    }
    
    a_ a(double paramDouble)
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      double[] arrayOfDouble = new double[this.g.length];
      int i = 0;
      do
      {
        if (i >= this.g.length) {
          break;
        }
        if (bool2) {
          break label70;
        }
        double d1 = this.g[i];
        if (bool1) {
          break label67;
        }
        arrayOfDouble[i] = (d1 * paramDouble);
        i++;
      } while (!bool1);
      label67:
      label70:
      return a(arrayOfDouble);
    }
    
    double a()
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      if (!bool2)
      {
        if (Double.isNaN(this.h)) {
          this.h = 0.0D;
        }
      }
      else
      {
        int i = 0;
        do
        {
          if (i >= this.g.length) {
            break;
          }
          if (bool1) {
            break label65;
          }
          this.h += this.g[i];
          i++;
        } while (!bool1);
      }
      label65:
      return this.h;
    }
    
    int b()
    {
      boolean bool = k.n;
      if (!bool) {
        if (this == a) {
          return 0;
        }
      }
      if (!bool) {
        if (this == b) {
          return 1;
        }
      }
      if (!bool) {
        if (this == c) {
          return 2;
        }
      }
      if (this == d) {
        return 3;
      }
      throw new IllegalArgumentException("not a direction " + this);
    }
    
    static a_ b(int paramInt)
    {
      boolean bool = k.n;
      if (!bool) {
        if (paramInt == 0) {
          return a;
        }
      }
      if (!bool) {
        if (paramInt == 1) {
          return b;
        }
      }
      if (!bool) {
        if (paramInt == 2) {
          return c;
        }
      }
      if (paramInt == 3) {
        return d;
      }
      throw new IllegalArgumentException("Invalid direction " + paramInt);
    }
    
    static a_ a(double[] paramArrayOfDouble)
    {
      if (paramArrayOfDouble.length == 2) {
        return a(paramArrayOfDouble[0], paramArrayOfDouble[1]);
      }
      return new a_(paramArrayOfDouble);
    }
    
    static a_ a(double paramDouble1, double paramDouble2)
    {
      if ((e.g[0] == paramDouble1) && (e.g[1] == paramDouble2)) {
        return e;
      }
      if ((a.g[0] == paramDouble1) && (a.g[1] == paramDouble2)) {
        return a;
      }
      if ((b.g[0] == paramDouble1) && (b.g[1] == paramDouble2)) {
        return b;
      }
      if ((c.g[0] == paramDouble1) && (c.g[1] == paramDouble2)) {
        return c;
      }
      if ((d.g[0] == paramDouble1) && (d.g[1] == paramDouble2)) {
        return d;
      }
      return new a_(paramDouble1, paramDouble2);
    }
    
    static a_ a(w paramw)
    {
      return a(paramw.a(), paramw.b());
    }
  }
  
  public static class b_
  {
    public static final b_ a = new b_(1.0D, 0.0D, 0.0D, 1.0D);
    public static final b_ b = new b_(0.0D, -1.0D, 1.0D, 0.0D);
    public static final b_ c = new b_(-1.0D, 0.0D, 0.0D, -1.0D);
    public static final b_ d = new b_(0.0D, 1.0D, -1.0D, 0.0D);
    public static final b_ e = new b_(1.0D, 0.0D, 0.0D, -1.0D);
    public static final b_ f = new b_(-1.0D, 0.0D, 0.0D, 1.0D);
    public static final b_ g = new b_(0.0D, -1.0D, -1.0D, 0.0D);
    public static final b_ h = new b_(0.0D, 1.0D, 1.0D, 0.0D);
    public static final List i;
    private final double[][] j = new double[2][2];
    private b_ k;
    private k.a_[] l;
    private k.a_[] m;
    public static boolean n;
    
    private static b_ a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      int i1 = 0;
      if (i1 < i.size()) {}
      label119:
      while (bool2)
      {
        b_ localb_ = (b_)i.get(i1);
        if (!bool2)
        {
          if (localb_.a(0, 0) == paramDouble1)
          {
            if (bool2) {
              break label119;
            }
            if (localb_.a(1, 0) == paramDouble3)
            {
              if (bool2) {
                break label119;
              }
              if (localb_.a(0, 1) == paramDouble2)
              {
                if (bool2) {
                  break label119;
                }
                if (localb_.a(1, 1) == paramDouble4) {
                  return localb_;
                }
              }
            }
          }
          i1++;
        }
        if (!bool1) {
          break;
        }
      }
      throw new IllegalArgumentException("No matrix found for the values " + paramDouble1 + " " + paramDouble2 + " " + paramDouble3 + " " + paramDouble4);
    }
    
    b_(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
    {
      this.j[0][0] = paramDouble1;
      this.j[0][1] = paramDouble2;
      this.j[1][0] = paramDouble3;
      this.j[1][1] = paramDouble4;
      this.l = new k.a_[] { k.a_.a(new double[] { this.j[0][0], this.j[1][0] }), k.a_.a(new double[] { this.j[0][1], this.j[1][1] }) };
      this.m = new k.a_[] { k.a_.a(this.j[0]), k.a_.a(this.j[1]) };
    }
    
    double a(int paramInt1, int paramInt2)
    {
      return this.j[paramInt1][paramInt2];
    }
    
    k.a_ a(int paramInt)
    {
      return this.m[paramInt];
    }
    
    k.a_ c(int paramInt)
    {
      return this.l[paramInt];
    }
    
    public b_ a(b_ paramb_)
    {
      double d1 = a(0).a(paramb_.c(0));
      double d2 = a(0).a(paramb_.c(1));
      double d3 = a(1).a(paramb_.c(0));
      double d4 = a(1).a(paramb_.c(1));
      return a(d1, d2, d3, d4);
    }
    
    public String toString()
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      StringBuffer localStringBuffer = new StringBuffer("Matrix:\n");
      int i1 = 0;
      label122:
      label124:
      do
      {
        if (i1 >= this.j.length) {
          break;
        }
        double[] arrayOfDouble = this.j[i1];
        if (!bool2)
        {
          if (bool1) {
            break label128;
          }
          localStringBuffer.append(i1).append(": ");
        }
        int i2 = 0;
        do
        {
          if (i2 >= arrayOfDouble.length) {
            break;
          }
          double d1 = arrayOfDouble[i2];
          localStringBuffer.append(d1);
          localStringBuffer.append(' ');
          i2++;
          if (bool2) {
            break label124;
          }
          if (bool1) {
            break label122;
          }
        } while (!bool1);
        localStringBuffer.append('\n');
        if (!bool2) {
          i1++;
        }
      } while (!bool1);
      label128:
      return localStringBuffer.toString();
    }
    
    b_ a()
    {
      return this.k;
    }
    
    public boolean b(b_ paramb_)
    {
      boolean bool = k.n;
      if ((bool) || (this.m[0].a(paramb_.m[0]))) {
        if (bool) {}
      }
      return this.m[1].a(paramb_.m[1]);
    }
    
    static
    {
      ArrayList localArrayList = new ArrayList(10);
      localArrayList.add(a);
      localArrayList.add(b);
      localArrayList.add(c);
      localArrayList.add(d);
      localArrayList.add(e);
      localArrayList.add(f);
      localArrayList.add(g);
      localArrayList.add(h);
      i = Collections.unmodifiableList(localArrayList);
      a.k = a;
      b.k = d;
      d.k = b;
      c.k = c;
      e.k = e;
      f.k = f;
      g.k = g;
      h.k = h;
    }
  }
  
  public static abstract class c_
  {
    public static final c_ a = new k.3();
    public static final c_ b = new k.4();
    public static final c_ c = new k.5();
    public static final c_ d = new k.6();
    public static final c_ e = new k.7();
    public static final c_ f = new k.8();
    public static final c_ g = new k.9();
    public static final c_[] h = { a, g, c, e, f, d };
    public static boolean i;
    
    final void a(v paramv, List paramList, double paramDouble)
    {
      a(paramv, paramList, a(paramList), paramDouble);
    }
    
    final void a(v paramv, v[] paramArrayOfv, double paramDouble)
    {
      a(paramv, Arrays.asList(paramArrayOfv), paramDouble);
    }
    
    protected abstract void a(v paramv, List paramList, Rectangle2D paramRectangle2D, double paramDouble);
    
    protected static Rectangle2D a(List paramList)
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      Rectangle2D.Double localDouble = new Rectangle2D.Double(1.7976931348623157E+308D, 1.7976931348623157E+308D, 0.0D, 0.0D);
      Iterator localIterator = paramList.iterator();
      do
      {
        do
        {
          double d4;
          do
          {
            if (!localIterator.hasNext()) {
              break;
            }
            v localv = (v)localIterator.next();
            double d1 = localv.h();
            if (!bool2) {
              if (d1 < localDouble.x) {
                localDouble.x = d1;
              }
            }
            double d2 = localv.i();
            if (!bool2) {
              if (d2 < localDouble.y) {
                localDouble.y = d2;
              }
            }
            double d3 = localv.g();
            if (!bool2) {
              if (d3 > localDouble.x + localDouble.width) {
                localDouble.width = (d3 - localDouble.x);
              }
            }
            d4 = localv.d();
          } while (d4 <= localDouble.y + localDouble.height);
          if ((bool2) || (bool1)) {
            break label196;
          }
          localDouble.height = (d4 - localDouble.y);
        } while (bool2);
      } while (!bool1);
      label196:
      return localDouble;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.n.k

 * JD-Core Version:    0.7.0.1

 */